var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, c, b) {
    if (status == 0 && e == 0) {
        im.dispose();
        return
    }(e == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            var f = im.getItemId();
            im.gainItem(f, -1);
            var d = im.rand(2630034, 2630087);
            im.gainItem(d, 1);
            im.sendNormalTalk("是#b#i" + d + ":# #t" + d + ":##n#k！快打开看看吧！", 4, 1012108, false, true)
        } else {
            im.dispose()
        }
    }
};